home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 June / SGI Freeware 1998 June.iso / dist / fw_ATxgopher.idb / usr / freeware / src / xgopher.1.3 / resources.h.z / resources.h
C/C++ Source or Header  |  1998-01-21  |  11KB  |  267 lines

  1. /* resources.h
  2.    xgopher application resources and program options.  Also
  3.    function header for resources.c */
  4.  
  5.      /*---------------------------------------------------------------*/
  6.      /* Xgopher        version 1.3     08 April 1993                  */
  7.      /*                version 1.2     20 November 1992               */
  8.      /*                version 1.1     20 April 1992                  */
  9.      /*                version 1.0     04 March 1992                  */
  10.      /* X window system client for the University of Minnesota        */
  11.      /*                                Internet Gopher System.        */
  12.      /* Allan Tuchman, University of Illinois at Urbana-Champaign     */
  13.      /*                Computing and Communications Services Office   */
  14.      /* Copyright 1992, 1993 by                                       */
  15.      /*           the Board of Trustees of the University of Illinois */
  16.      /* Permission is granted to freely copy and redistribute this    */
  17.      /* software with the copyright notice intact.                    */
  18.      /*---------------------------------------------------------------*/
  19.  
  20. #ifndef RESOURCES_H
  21. #define RESOURCES_H
  22.  
  23. #include <X11/Intrinsic.h>
  24. #include <X11/StringDefs.h>
  25.  
  26. /* for the showLevel type... */
  27. #include "gui.h"
  28.  
  29.  
  30.  
  31. typedef struct {
  32.     Boolean        defaultsInstalled;
  33.     String        resourcesVersion;
  34.     String        rootServer;
  35.     int        rootPort;
  36.     String        mainTitle;
  37.     String        rootPath;
  38.     String        helpFile;
  39.     String        bookmarkFile;
  40.     Boolean        allowSave;
  41.     Boolean        allowPrint;
  42.     Boolean        allowTelnet;
  43.     Boolean        allowTn3270;
  44.     Boolean        allowBookmarkSave;
  45.     Boolean        allowCopy;
  46.     Boolean        allowImage;
  47.     Boolean        hasSound;
  48.     String        printCommand;
  49.     String        imageCommand;
  50.     String        soundCommand;
  51.     String        telnetCommand;
  52.     String        tn3270Command;
  53.     String        imageServers;
  54.     String        soundServers;
  55.     String        textServers;
  56.     Boolean        appendBookmarks;
  57.     Boolean        loadBookmarks;
  58.     Boolean        resetOptions;
  59.     Boolean        optionsButton;
  60.     Boolean        singleItemButton;
  61.     Boolean        swapRestartAndQuit;
  62.     Boolean        restartButton;
  63.     Boolean        dirHistory;
  64.     Boolean        nameText;
  65.     Boolean        commonText;
  66.     Boolean        allowFtp;
  67.     Boolean        publicMode;
  68.     Boolean        statusWindow;
  69.     int        showItems;
  70.     int        concurrentText;
  71.     Boolean        allowHold;
  72.     int        directoryTime;
  73.     int        itemStart;
  74.     int        itemIncrement;
  75.     int        dirStart;
  76.     int        dirIncrement;
  77.     Boolean        warpCursor;
  78.     Boolean        doubleClick;
  79.     Boolean        markRoot;
  80.     String        extendedTypes;
  81.     String        tempDirectory;
  82.     String        logFile;
  83.     String        prefixFile;
  84.     String        prefixDir;
  85.     String        prefixTelnet;
  86.     String        prefixTn3270;
  87.     String        prefixCSO;
  88.     String        prefixIndex;
  89.     String        prefixBinary;
  90.     String        prefixImage;
  91.     String        prefixSound;
  92.     String        prefixUnknown;
  93.     String        infoDirLabel;
  94.     String        markDirLabel;
  95.     } gopherAppResources, *gopherAppResourcesP;
  96.  
  97.  
  98. /* conf.h contains the default values for many of the resources */
  99.  
  100. #include "conf.h"
  101.  
  102. #define GOffset(x) XtOffset(gopherAppResourcesP, x)
  103.  
  104. static XtResource resources[] = {
  105.     {"defaultsInstalled", "DefaultsInstalled", XtRBoolean, sizeof(Boolean),
  106.         GOffset(defaultsInstalled), XtRImmediate, (XtPointer) False},
  107.     {"resourcesVersion", "ResourcesVersion", XtRString, sizeof(String),
  108.         GOffset(resourcesVersion), XtRString, "Unknown, pre-1.3"},
  109.     {"rootServer", "RootServer", XtRString, sizeof(String),
  110.         GOffset(rootServer), XtRString, ROOT_SERVER},
  111.     {"rootPort", "RootPort", XtRInt, sizeof(int),
  112.         GOffset(rootPort), XtRImmediate, (XtPointer) ROOT_PORT},
  113.     {"mainTitle", "MainTitle", XtRString, sizeof(String),
  114.         GOffset(mainTitle), XtRString, MAIN_TITLE},
  115.     {"rootPath", "RootPath", XtRString, sizeof(String),
  116.         GOffset(rootPath), XtRString, ROOT_PATH},
  117.     {"allowSave", "AllowSave", XtRBoolean, sizeof(Boolean),
  118.         GOffset(allowSave), XtRImmediate, (XtPointer) ALLOW_SAVE},
  119.     {"allowCopy", "AllowCopy", XtRBoolean, sizeof(Boolean),
  120.         GOffset(allowCopy), XtRImmediate, (XtPointer) ALLOW_COPY},
  121.     {"allowPrint", "AllowPrint", XtRBoolean, sizeof(Boolean),
  122.         GOffset(allowPrint), XtRImmediate, (XtPointer) ALLOW_PRINT},
  123.     {"allowTn3270", "AllowTn3270", XtRBoolean, sizeof(Boolean),
  124.         GOffset(allowTn3270), XtRImmediate, (XtPointer) ALLOW_TN3270},
  125.     {"printCommand", "PrintCommand", XtRString, sizeof(String),
  126.         GOffset(printCommand), XtRString, PRINT_COMMAND},
  127.     {"helpFile", "HelpFile", XtRString, sizeof(String),
  128.         GOffset(helpFile), XtRString, HELP_FILE},
  129.     {"bookmarkFile", "BookmarkFile", XtRString, sizeof(String),
  130.         GOffset(bookmarkFile), XtRString, BOOKMARK_FILE},
  131.     {"imageServers", "Servers", XtRString, sizeof(String),
  132.         GOffset(imageServers), XtRString, ""},
  133.     {"soundServers", "Servers", XtRString, sizeof(String),
  134.         GOffset(soundServers), XtRString, ""},
  135.     {"textServers", "Servers", XtRString, sizeof(String),
  136.         GOffset(textServers), XtRString, ""},
  137.     {"allowBookmarkSave", "AllowBookmarkSave", XtRBoolean, sizeof(Boolean),
  138.         GOffset(allowBookmarkSave), XtRImmediate,
  139.         (XtPointer) ALLOW_BOOKMARK_SAVE},
  140.     {"appendBookmarks", "AppendBookmarks", XtRBoolean, sizeof(Boolean),
  141.         GOffset(appendBookmarks), XtRImmediate,
  142.         (XtPointer) APPEND_BOOKMARKS},
  143.     {"swapRestartAndQuit", "SwapRestartAndQuit", XtRBoolean, sizeof(Boolean),
  144.         GOffset(swapRestartAndQuit), XtRImmediate,
  145.         (XtPointer) SWAP_RESTART_QUIT},
  146.     {"restartButton", "RestartButton", XtRBoolean, sizeof(Boolean),
  147.         GOffset(restartButton), XtRImmediate,
  148.         (XtPointer) RESTART_BUTTON},
  149.     {"optionsButton", "OptionsButton", XtRBoolean, sizeof(Boolean),
  150.         GOffset(optionsButton), XtRImmediate,
  151.         (XtPointer) OPTIONS_BUTTON},
  152.     {"singleItemButton", "SingleItemButton", XtRBoolean, sizeof(Boolean),
  153.         GOffset(singleItemButton), XtRImmediate,
  154.         (XtPointer) SINGLE_ITEM_BUTTON},
  155.     {"showItems", "ShowItems", XgRShowLevel, sizeof(int),
  156.         GOffset(showItems), XtRImmediate, (XtPointer) showAll},
  157.     {"allowFtp", "AllowFtp", XtRBoolean, sizeof(Boolean),
  158.         GOffset(allowFtp), XtRImmediate, (XtPointer) ALLOW_FTP},
  159.     {"publicMode", "PublicMode", XtRBoolean, sizeof(Boolean),
  160.         GOffset(publicMode), XtRImmediate, (XtPointer) PUBLIC_MODE},
  161.     {"statusWindow", "StatusWindow", XtRBoolean, sizeof(Boolean),
  162.         GOffset(statusWindow), XtRImmediate, (XtPointer) STATUS_WINDOW},
  163.     {"dirHistory", "DirHistory", XtRBoolean, sizeof(Boolean),
  164.         GOffset(dirHistory), XtRImmediate, (XtPointer) DIR_HISTORY},
  165.     {"nameText", "NameText", XtRBoolean, sizeof(Boolean),
  166.         GOffset(nameText), XtRImmediate, (XtPointer) NAME_TEXT},
  167.     {"commonText", "CommonText", XtRBoolean, sizeof(Boolean),
  168.         GOffset(commonText), XtRImmediate, (XtPointer) COMMON_TEXT},
  169.     {"concurrentText", "ConcurrentText", XtRInt, sizeof(int),
  170.         GOffset(concurrentText), XtRImmediate,
  171.         (XtPointer)CONCURRENT_TEXT},
  172.     {"allowHold", "AllowHold", XtRBoolean, sizeof(Boolean),
  173.         GOffset(allowHold), XtRImmediate, (XtPointer) ALLOW_HOLD},
  174.     {"directoryTime", "DirectoryTime", XtRInt, sizeof(int),
  175.         GOffset(directoryTime), XtRImmediate,
  176.         (XtPointer)DIRECTORY_TIME},
  177.     {"allowImage", "AllowImage", XtRBoolean, sizeof(Boolean),
  178.         GOffset(allowImage), XtRImmediate, (XtPointer) ALLOW_IMAGE},
  179.     {"imageCommand", "ImageCommand", XtRString, sizeof(String),
  180.         GOffset(imageCommand), XtRString, IMAGE_COMMAND},
  181.     {"hasSound", "HasSound", XtRBoolean, sizeof(Boolean),
  182.         GOffset(hasSound), XtRImmediate, (XtPointer) HAS_SOUND},
  183.     {"soundCommand", "SoundCommand", XtRString, sizeof(String),
  184.         GOffset(soundCommand), XtRString, SOUND_COMMAND},
  185.     {"allowTelnet", "AllowTelnet", XtRBoolean, sizeof(Boolean),
  186.         GOffset(allowTelnet), XtRImmediate, (XtPointer) ALLOW_TELNET},
  187.     {"telnetCommand", "TelnetCommand", XtRString, sizeof(String),
  188.         GOffset(telnetCommand), XtRString, TELNET_COMMAND},
  189.     {"tn3270Command", "Tn3270Command", XtRString, sizeof(String),
  190.         GOffset(tn3270Command), XtRString, TN3270_COMMAND},
  191.     {"loadBookmarks", "LoadBookmarks", XtRBoolean, sizeof(Boolean),
  192.         GOffset(loadBookmarks), XtRImmediate,
  193.         (XtPointer) LOAD_BOOKMARKS},
  194.     {"resetOptions", "ResetOptions", XtRBoolean, sizeof(Boolean),
  195.         GOffset(resetOptions), XtRImmediate,
  196.         (XtPointer) RESET_OPTIONS},
  197.     {"itemStart", "ItemStart", XtRInt, sizeof(int),
  198.         GOffset(itemStart), XtRImmediate, (XtPointer) ITEMS_TO_START},
  199.     {"itemIncrement", "ItemIncrement", XtRInt, sizeof(int),
  200.         GOffset(itemIncrement), XtRImmediate,
  201.         (XtPointer) ITEMS_TO_ADD},
  202.     {"dirStart", "DirStart", XtRInt, sizeof(int),
  203.         GOffset(dirStart), XtRImmediate, (XtPointer) DIRS_TO_START},
  204.     {"dirIncrement", "DirIncrement", XtRInt, sizeof(int),
  205.         GOffset(dirIncrement), XtRImmediate, (XtPointer) DIRS_TO_ADD},
  206.     {"warpCursor", "WarpCursor", XtRBoolean, sizeof(Boolean),
  207.         GOffset(warpCursor), XtRImmediate, (XtPointer) WARP_CURSOR},
  208.     {"doubleClick", "DoubleClick", XtRBoolean, sizeof(Boolean),
  209.         GOffset(doubleClick), XtRImmediate, (XtPointer) DOUBLE_CLICK},
  210.     {"markRoot", "MarkRoot", XtRBoolean, sizeof(Boolean),
  211.         GOffset(markRoot), XtRImmediate, (XtPointer) MARK_ROOT},
  212.     {"extendedTypes", "ExtendedTypes", XtRString, sizeof(String),
  213.         GOffset(extendedTypes), XtRString, ""},
  214.     {"tempDirectory", "TempDirectory", XtRString, sizeof(String),
  215.         GOffset(tempDirectory), XtRString, TEMP_DIRECTORY},
  216.     {"logFile", "LogFile", XtRString, sizeof(String),
  217.         GOffset(logFile), XtRImmediate, NULL},
  218.     {"prefixFile", "PrefixFile", XtRString, sizeof(String),
  219.         GOffset(prefixFile), XtRString, PREFIX_FILE},
  220.     {"prefixDir", "PrefixDir", XtRString, sizeof(String),
  221.         GOffset(prefixDir), XtRString, PREFIX_DIR},
  222.     {"prefixTelnet", "PrefixTelnet", XtRString, sizeof(String),
  223.         GOffset(prefixTelnet), XtRString, PREFIX_TELNET},
  224.     {"prefixTn3270", "PrefixTn3270", XtRString, sizeof(String),
  225.         GOffset(prefixTn3270), XtRString, PREFIX_TN3270},
  226.     {"prefixCSO", "PrefixCSO", XtRString, sizeof(String),
  227.         GOffset(prefixCSO), XtRString, PREFIX_CSO},
  228.     {"prefixIndex", "PrefixIndex", XtRString, sizeof(String),
  229.         GOffset(prefixIndex), XtRString, PREFIX_INDEX},
  230.     {"prefixBinary", "PrefixBinary", XtRString, sizeof(String),
  231.         GOffset(prefixBinary), XtRString, PREFIX_BINARY},
  232.     {"prefixImage", "PrefixImage", XtRString, sizeof(String),
  233.         GOffset(prefixImage), XtRString, PREFIX_IMAGE},
  234.     {"prefixSound", "PrefixSound", XtRString, sizeof(String),
  235.         GOffset(prefixSound), XtRString, PREFIX_SOUND},
  236.     {"prefixUnknown", "PrefixUnknown", XtRString, sizeof(String),
  237.         GOffset(prefixUnknown), XtRString, PREFIX_UNKNOWN},
  238.     {"infoDirectoryLabel", "Label", XtRString, sizeof(String),
  239.         GOffset(infoDirLabel), XtRString, "Info about\nDirectory"},
  240.     {"markDirectoryLabel", "Label", XtRString, sizeof(String),
  241.         GOffset(markDirLabel), XtRString, "Mark\nDirectory"},
  242.     };
  243.  
  244. #undef GOffset
  245.  
  246. void            saveChangableResources(
  247. #ifdef PROTO
  248.                 gopherAppResourcesP    /* arP */
  249. #endif
  250. );
  251.  
  252. void            restoreChangableResources(
  253. #ifdef PROTO
  254.                 gopherAppResourcesP    /* arP */
  255. #endif
  256. );
  257.  
  258. gopherAppResources    *getApplicationResources(
  259. #ifdef PROTO
  260.                 Widget,        /* topLevel */
  261.                 int,        /* argc */
  262.                 char **        /* argv */
  263. #endif
  264. );
  265.  
  266. #endif   /* RESOURCES_H */
  267.